<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery.js" ></script>
    <script>
        // 固定写法，页面加载后出发
        $(document).ready((function() {

            $("#username").html(window.localStorage.user)

        }))
    </script>
</head>
<body>
    Welcome!! <span id="username"></span>
</body>
</html>